$search-height: 50px;
$body-padding: 5px;

iframe#analytics {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

%outline {
  outline-color: rgb(24, 166, 236);
  outline-style: auto;
  outline-width: 3px;
}

* {
  &::-webkit-scrollbar {
    width: 5px;
    background-color: rgba(0, 0, 0, 0.06);
  }

  &::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    min-height: 15px;
    border-radius: 2px;
  }

  &::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.3);
  }

  &::-webkit-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.5);
  }
}

*:focus {
  outline-style: none;
}

.hidden {
  display: none;
}

body {
  font-family: sans-serif;
  box-sizing: content-box;
  height: auto;
  margin: 0;
  padding: $body-padding;
  overflow: hidden;
}

.search-wrapper {
  z-index: 1000;
  width: 100%;
  height: auto;
  background: white;
  padding-bottom: $body-padding * 2;

  .search {
    box-sizing: border-box;
    width: 100%;
    height: $search-height;
    margin: 0 auto;
    line-height: 40px;
    padding-left: $body-padding;
    font-size: 24px;
    border: 1px solid #ccc;
    border-radius: 3px;

    &:focus {
      @extend %outline;
    }
  }
}

li,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.items {
  box-sizing: border-box;
  margin: 0 -$body-padding;
  padding: $body-padding;
  word-break: break-all;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;

  &:empty {
    padding: 0;
  }

  .item {
    position: relative;
    padding: 5px;

    &.select {
      background-color: rgba(100, 214, 245, 0.08);
    }

    &:focus,
    &.select {
      @extend %outline;
    }

    .icon {
      position: absolute;
      left: 5px;
      top: 5px;
      width: 40px;
      height: 40px;
      background-position: center;
    }

    .info {
      margin-left: 55px;
    }

    .name {
      font-size: 20px;
      line-height: 30px;
    }

    .key {
      float: right;
      margin-right: 5px;
      font-size: 14px;
      color: #666;
    }

    .detail {
      clear: both;
      font-size: 12px;
      line-height: 16px;
      color: #999;
    }

    &.select .btn-group {
      height: auto;
    }
  }
}

.btn-group {
  height: 0;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  text-align: right;
}

.btn {
  display: inline;
  margin-right: 10px;
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid;
  border-radius: 3px;
  background-color: transparent;
  outline-width: none;

  @each $index,$color in (0:#fa8e10, 1:#7ee03e, 2:#19c6a4, 3:#6d609c,
  4:#b16d3a, 5:#24b564, 6:#e33636, 7:#c8c222) {
    &.color-#{$index} {
      border-color: $color;
      color: $color;

      &.select {
        background-color: $color;
        color: white;
      }
    }
  }
}
